﻿<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
   <meta charset="utf-8" />
  	  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>ManageSystem管理系统</title> 
    <!-- bootstrap 3.0.2 -->
    <link href="/resource/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <!-- Theme style -->
    <link href="/resource/css/style.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="/resource/js/jQueryMessage/css/message.skin.css" />
	<style>
		.stu_left{
			float: left;
			width: 300px;
		}
		.stu_center{
			float: left;
			width: 300px;
		}
		.stu_right{
			float: left;
			width: 300px;
		}
		select{
			width: 250px;
		}
	</style>
</head>

<body>
	<div class="row">
	    <div class="col-md-12">
	    	<h1 class="panel-heading">修改教师</h1>
	        <!--breadcrumbs start -->
	        <ul class="breadcrumb">
				<li><a href="/index/toIndex"><i class="fa fa-home"></i> 首页</a></li>
				<li class="active">修改教师</li>
			</ul>
	        <!--breadcrumbs end -->
	    </div>
	</div>
	<div class="row">
		<div class="col-lg-12">
			<section class="panel">
				<div class="panel-body">
					<form class="col s12" id="form1" enctype="multipart/form-data" th:action="@{/stu/teacher/add}" onsubmit="return validateForm();" method="post">
						<input type="hidden" th:value="${teacher.id}" id="id" name="id"/>
						<div class="stu_left">
							<div class="form-group form-control-medium">
								<label for="collegeId">学院：</label>
								<input id="collegeId" name="collegeId" type="text" th:value="${teacher.collegeId}" class="form-control"/>
							</div>
							<div class="form-group form-control-medium">
								<label for="teacherId">工号：</label>
								<input id="teacherId" name="teacherId" disabled='disabled' type="text" th:value="${teacher.teacherId}" class="form-control"/>
							</div>
							<div class="form-group form-control-medium">
								<label for="name">姓名：</label>
								<input id="name" name="name" type="text" th:value="${teacher.name}" class="form-control"/>
							</div>
							<div class="form-group form-control-medium">
								<label for="engName">英文名：</label>
								<input id="engName" name="engName" type="text" th:value="${teacher.engName}" class="form-control"/>
							</div>
							<div class="form-group form-control-medium">
								<label for="nation">民族：</label>
								<input id="nation" name="nation" type="text" th:value="${teacher.nation}" class="form-control"/>
							</div>
							<div class="form-group form-control-medium">
								<label for="birth">出生日期：</label>
								<input id="birth" name="birth" type="date" th:value="${#dates.format(teacher.birth,'yyyy-MM-dd')}" class="form-control"/>
							</div>
						</div>
						<div class="stu_center">
							<div class="form-group form-control-medium">
								<label for="age">年龄(22-60)：</label>
								<input id="age" name="age" type="number" min="22" max="60" th:value="${teacher.age}" class="form-control"/>
							</div>
							<div class="form-group form-control-medium">
								<label for="address">现居住地：</label>
								<input id="address" name="address" type="text" th:value="${teacher.address}" class="form-control"/>
							</div>
							<div class="form-group form-control-medium">
								<label for="phone">电话：</label>
								<input id="phone" name="phone" type="text" th:value="${teacher.phone}" class="form-control"/>
							</div>
							<div class="form-group form-control-medium">
							<label for="status">状态：</label>
							<select class="form-group" id="status" name="status" th:value="${teacher.status}">
								<option value="0" th:selected="${teacher.status == '0' ? 'true' : 'false'}">启用</option>
								<option value="1" th:selected="${teacher.status == '1' ? 'true' : 'false'}">禁用</option>
							</select>
							</div>
							<div class="form-group form-control-medium">
							<label for="gender">性别：</label>
							<select class="form-group" id="gender" name="gender" th:value="${teacher.gender}">
								<option value="1" th:selected="${teacher.gender == '1' ? 'true' : 'false'}">男</option>
								<option value="0" th:selected="${teacher.gender == '0' ? 'true' : 'false'}">女</option>
							</select>
							</div>
							<div class="form-group form-control-medium">
							<label for="rank">职称：</label>
							<select class="form-group" id="rank" name="rank">
								<option th:selected="${teacher.rank == '1' ? 'true' : 'false'}" value="1">教师</option>
								<option value="2" th:selected="${teacher.rank == '2' ? 'true' : 'false'}">副教授</option>
								<option value="3" th:selected="${teacher.rank == '3' ? 'true' : 'false'}">教授</option>
							</select>
							</div>
						</div>
						<div class="stu_right">
							<div class="form-group form-control-medium">
							<label for="marital">婚姻状况：</label>
							<select class="form-group" id="marital" name="marital" th:value="${teacher.marital}">
								<option value="1" th:selected="${teacher.marital == '1' ? 'true' : 'false'}">未婚</option>
								<option value="0" th:selected="${teacher.marital == '0' ? 'true' : 'false'}">已婚</option>
							</select>
							</div>
							<input id="updatedBy" name="updatedBy" type="hidden" class="form-control" />
							<div class="form-btn-group-left">
			            		<button type="submit" class="btn btn-info">保存</button>
								<button type="button" class="btn btn-info" id="back"><a href="/stu/teacher/list">返回</a></button>
			            	</div>
						</div>
					</form>
				</div>
			</section>
		</div>
	</div>
	<script src="/resource/js/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="/resource/js/jQueryMessage/js/jquery.plugin.message.js"></script>
        <script type="text/javascript" th:inline="javascript">
	   	/* 保存方法 */
	    function validateForm(){
			return true;
	    }

		//获取当前登录的用户
		var userStr = sessionStorage.getItem("douglas");
		if(userStr == null || userStr == "" || userStr == "undefined"){
			window.location.href = "/admin/user/toLogin";
		}else{
			var user = JSON.parse(userStr);
			$("#updatedBy").val(user.realname);
		}
    </script>
</body>
</html>
